<!DOCTYPE html>
<!-- saved from url=(0043)https://www.haoqiao.com/admin/account_info/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="renderer" content="webkit">
    
    <title>客户资料 - 好巧网</title>
    <link rel="stylesheet" href="css/global.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/voucher.css">
    <link rel="stylesheet" href="css/account.css">
    <link type="text/css" href="css/iconfont.css" rel="stylesheet">
    <style type="text/css">
        .mr6{margin-right:6px;}
        .pl6{padding-left:6px;}
        /*----------- 浮层 -----------*/
        .index-popup{position:absolute;z-index:205;background:#fff;width:600px}
        .index-popup-title{position:relative;height:50px;line-height:50px;color:#fff;background:#4f5f6f;font-size:16px;padding:0 15px;}
        .index-popup-close{position:absolute;right:15px;top:17px;width:16px;height:16px;background:url(https://img.haoqiao.com/website/images/index_close.gif) no-repeat;}
        .index-popup-close:hover{-moz-transform: rotate(180deg);-webkit-transform: rotate(180deg);-o-transform: rotate(180deg);transform: rotate(180deg);}
        .index-popup-btn-center{margin:20px 0 30px;text-align:center;}
        .index-popup-btn{display:inline-block;width:140px;height:40px;line-height:40px;background:#49f;border-radius:3px;border:0;color:#fff;text-align:center;font-size:16px;cursor:pointer;margin-right:10px}
        .order-del-pop-cal-table{width:505px;margin:20px auto 20px;}
        .order-del-pop-cal-table td{height:50px;padding:0 10px;border:solid 1px #eee;}
        .order-del-pop-btn{margin:20px 0;padding:10px 10px 0 0;border-top:solid 1px #ddd;font-size:14px;}
        .order-del-pop-btn .index-popup-btn{width:158px;}
        .order-del-pop-btn .index-popup-btn:hover{background:#5da7ff;}
        .order-del-pop-btn .order-del-pop-btn-cal{height:38px;line-height:38px;border:1px solid #49f;background: #fff;color: #49f;}
        .order-del-pop-btn .order-del-pop-btn-cal:hover{background: #49f;color: #fff;}
        .popup-alert-main td{padding: 5px 10px;}
        .popup-alert-main div{line-height: 30px;}
        .popup-alert-title input{height:30px;line-height:30px;}
        .popup-alert-title label{display: inline-block;width: auto;margin-right:20px}
        #bg{position:absolute;z-index:101;top:0;left:0;background:#000;opacity:0.5;filter:alpha(opacity=50);}
        .main-table .main-table-v-td-l{background:#f6f6f6;width:260px;}
        .main-table .main-table-v-td-r{text-align:left;padding-left:5px;}
        .main-table .main-table-v-td-r .upload{width: 100px;height: 27px;border: none;display: inline-block;background: #49f;border-radius: 2px;color: #fff;text-align: center;cursor: pointer;}
        .main-table-v th{text-align:left;font-weight:700;color:#333;}
        .main-table-v .main-table-v-td-r td{padding:6px 0 6px 0;text-align:left;border:solid 1px #333333;}
        .main-table-v tr:hover{background:#ffffff}

        .main-table-v .main-table-v-td-l{background:#f6f6f6;width:200px;text-align:center}
        .main-table-v .main-add-check td{border:0px}
        .main-table-v .main-invoice-check td{border:0px}
        .main-table-v .main-invoice-check th{background:#ffffff}
        .main-check{border: 4px solid #E1EAEE;}
        .main-title-check{border-top: 3px solid #2C468B;}
        .main-title-check th{background:#ffffff}
        .clean_upload{cursor:pointer;color:#4499ff}
        .appedit-sub{margin:30px 0 100px 280px;background: #49f;  color: #fff;}

        .account-form-r{float:left;}
        .account-form-r .account-form-r-c{width:186px;border:1px solid #dddddd;border-radius:4px;height:22px;line-height:22px;appearance:none;  -moz-appearance:none; -webkit-appearance:none;  background: url("https://img.haoqiao.com/website/images/register/down.svg") no-repeat scroll right center transparent;    background-position: 165px;padding-right: 14px; font-family: Helvetica, "Microsoft Yahei", "Hiragino Sans GB", "黑体", Arial, \5b8b\4f53;background-color:#ffffff;padding-left: 12px;padding-right: 12px;color: #c7c7cd;float:left;position: relative;cursor: pointer;}
        .account-form-r  ul{width: 189px;background: #fff;border: solid 1px #ccc;border-radius: 4px;box-shadow: 0px 0 8px rgba(100, 100, 100, 0.5);position: absolute;z-index: 91;min-height: 100px;max-height: 360px;overflow: auto;margin-top:25px;}
        .account-form-r  ul li a {display: block;height: 20px;line-height: 20px;padding: 0 4px 0 10px;border-bottom: solid 1px #ccc;color: #666;font-size: 12px;font-family: Helvetica, "Microsoft Yahei", "Hiragino Sans GB", "黑体", Arial, \5b8b\4f53;}
        .account-form-r .account-form-r-c.phone_code{margin-top:4px;width:30px;border:1px solid #ddd;border-right:none;border-radius:4px 0 0 4px;height:20px;line-height:20px;appearance:none;  -moz-appearance:none; -webkit-appearance:none;  background: url("https://img.haoqiao.com/website/images/register/down.svg") no-repeat scroll right center transparent;    background-position: 38px;padding-right: 14px; font-family: Helvetica, "Microsoft Yahei", "Hiragino Sans GB", "黑体", Arial, \5b8b\4f53;background-color:#ffffff;padding-left: 6px;padding-right: 18px;color: #999999;float:left;position: relative;cursor: pointer;}
        .account-form-r input[name="phone"]{border:1px solid #ddd;height:22px;border-radius:0 4px 4px 0;width:305px;font-size:12px;color:#c7c7cd;padding-left:12px;padding-right:12px}
        .account-form-r input[type=text]{height:20px;line-height:20px;background:#fff;border-radius:0 4px 4px 0;}
        .popup-alert-content input:not([type=checkbox]){height:20px;line-height:20px;border:1px solid #ddd;}
        .popup-alert-content-mail .t_alert_email_main{height:30px;}
        .popup-alert-content-mail .t_alert_email_main input{ width:161px;margin-top:4px;}
        .J_sel_ul_phone_code li:hover,.J_sel_ul_province li:hover,.J_sel_ul_city li:hover{background-color: #f1f1f1;}
        .J_sel_ul_phone_code a span{float: right;color: #999;}

    </style>
</head>
<body style="background:#fff;padding:20px">


<div class="main-wrap user-info-box" id="J_selectall">
    <ul class="operation-tab clearfix">
        <li :class="{current: showUser}" @click="showUser = true">
            <a href="javascript:;">企业信息</a>
        </li>
        <li :class="{current: !showUser}" @click="showUser = false">
            <a href="javascript:;">我的信息</a>
        </li>
    </ul>
    <template v-if="showUser">
        <div class="form-title"><span class="account-type-name">基础信息</span></div>
        <div class="appedit" style="position: relative;margin:10px 10px 10px;">
            <table class="main-table" width="900px">
                <!--企业认证-->
                <tbody>
                <!--<tr class="certification_tr">
                    <td colspan="2" style="overflow: inherit;">
                        <div class="certification radius-2 clearfix">
                            <div class="certification_left clearfix fl tal">
                                <span class="span_img dib"><i class="icon-certification  iconfont"></i></span>
                                <span class="span_info dib">
                                <b class="db">
                                    <font>企业实名认证</font>
                                    &lt;!&ndash;                                    &ndash;&gt;                                    <font class="rel">
                                        <i class="icon-notice iconfont f14 t-999 pointer J_icon-notice" style="font-size:14px;"></i>
                                        <div class="icon_notice_tips t-666 bg-fff abs triangle-up radius-4 hq-shadow-box s f12 p10 hide J_icon_notice_tips">
                                            <p class="tips_title b f12 t-333">通过实名认证获得以下权益：</p>
                                            <p class="tips_content f12 t-666">1、签署电子合同安全快捷</p>
                                            <p class="tips_content f12 t-666">2、提升账户安全享受更多保障服务</p>
                                        </div>
                                    </font>
                                    &lt;!&ndash;                                    &ndash;&gt;                                </b>
                                <em class="t-999 ">未认证</em>
                                                                <i class="icon-certification-status  iconfont dib"></i>
                                                            </span>
                            </div>
                            <div class="certification_right fr clearfix rel">
                                <a href="javascript:;" class="dib t-49f J_certification">立即认证</a>
                                <div class="certification_tips hide t-666 bg-fff abs triangle-up radius-4 hq-shadow-box s f12 p10 J_certification_tips">
                                    请登录主账号提交认证信息
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>-->
                <tr>
                    <td style="background:#f6f6f6;width:30%;">客户编号</td>
                    <td>{{companyInfo.company_code}}</td>
                </tr>
                <tr>
                    <td style="background:#f6f6f6">客户名称</td>
                    <td>{{companyInfo.company_name}}</td>
                </tr>
                <tr>
                    <td style="background:#f6f6f6">公司地址</td>
                    <td>{{companyInfo.company_address}}</td>
                </tr>
                <tr>
                    <td style="background:#f6f6f6">传真</td>
                    <td>{{companyInfo.tax}}</td>
                </tr>
                </tbody></table>
        </div>
    </template>
    <template v-else>
        <div class="form-title"><span class="account-type-name">基础信息</span></div>
        <div class="appedit" style="position: relative;margin:10px 10px 10px;">
            <table class="main-table" width="900px">
                <!--企业认证-->
                <tbody>
                <tr>
                    <td style="background:#f6f6f6;width:30%;">客户编号</td>
                    <td>{{userInfo.company_code}}</td>
                </tr>
                <tr>
                    <td style="background:#f6f6f6">客户名称</td>
                    <td>{{userInfo.nick_name}}</td>
                </tr>
                <tr>
                    <td style="background:#f6f6f6">邮件地址</td>
                    <td>{{userInfo.email}}</td>
                </tr>
                </tbody></table>
        </div>
    </template>

</div>

<div id="bg"></div>

<style>
    .edit-lang,.edit-lang-toast{position: fixed;top:0;left:0;width:100%;height:100%;text-align: center;}
    .edit-lang{z-index:102;}
    .pos-center{width:600px;margin:0 auto;background-color: #fff;border-radius: 3px;margin-top:10%;}
    .edit-title{height:50px;line-height:50px;background:#4f5f6f;padding: 0 15px;position:relative;color:#fff;text-align:left;}
    .edit-title span{display: inline-block;height:30px;line-height: 30px;font-size:16px;}
    .edit-title img{width:16px;height: 16px;position:absolute;right:15px;top:50%;margin-top:-8px;cursor: pointer;}
    .edit-con{max-width:522px;padding:30px 0;margin: 0 auto;}
    .edit-con-box > p{height:40px;line-height:40px;margin-right: 10px;}
    .edit-line:nth-child(2){padding-left: 10px;height:30px;line-height:30px;}
    .edit-line .lang-ipt{width:378px;height:38px;line-height:38px;padding: 0 10px;border:1px solid #ddd;border-radius: 3px;cursor: pointer;}
    .edit-line .lang-list{box-shadow: 0px 0 8px rgba(100, 100, 100, 0.5);left:0;top: 39px;}
    .edit-line .lang-list li {height: 37px;line-height:37px;cursor: pointer;padding: 0 10px;}
    .edit-line .lang-list li:hover{background:#eef6ff;}
    .edit-bot{padding: 10px 0;border-top:1px solid #ececec;}
    .edit-bot span{display:block;width: 158px;height:40px;line-height:40px;border-radius: 3px;font-size: 14px;cursor: pointer;}
    .edit-bot span.lang-cancel{height:38px;line-height:38px;border:1px solid #49f;color:#49f;}
    .edit-bot span.lang-cancel:hover{background:#49f;color:#fff;}
    .edit-bot span.lang-done{background-color: #49f;color:#fff;margin-right: 10px;}
    .edit-bot span.lang-done:hover{background:#5da7ff;}
    .toast-center{width: 80px;padding:10px 30px;background-color: #fff;border-radius: 3px;box-shadow:0px 0px  10px 5px #aaa;margin:15% auto 0;}
    .search-arrow-down{display: block;width: 15px;height: 5px;background: url("https://img.haoqiao.com/website/images/details_search_down.svg") no-repeat;margin-top: -2.5px;border: 0;position: absolute;top: 50%;right: 6px;}
    .search-arrow-up{background-image: url("https://img.haoqiao.com/website/images/details_search_up.svg");}
</style>
<div class="edit-lang" style="display: none;">
    <div class="pos-center">
        <div class="edit-title">
            <span>设置默认语言</span>
            <img src="images/index_close.gif" alt="">
        </div>
        <div class="edit-con dif jcc">
            <div class="edit-con-box clearfix">
                <p class="nowrap fl f14 t-666">默认语言</p>
                <div class="fl">
                    <div class="edit-line f14 t-666 rel">
                                                <div class="lang-ipt f14 t-666 tal rel" id="lang-ipt" is-show="0" data-type="zh">
                            <span>中文</span>
                            <i class="search-arrow-down"></i>
                            <ul class="lang-list abs w100p hide bg-fff tal">
                                <li data-type="zh">中文</li>
                                <li data-type="en">英文</li>
                            </ul>
                        </div>


                    </div>
                    <div class="edit-line t-999 f12 tal">设置语言，邮件、短信等将以该语言为主</div>
                </div>
            </div>
        </div>
        <div class="edit-bot dif jcc">
            <span class="lang-done">确定</span>
            <span class="lang-cancel">取消</span>
        </div>
    </div>
</div>

<div class="edit-lang-toast" style="display: none;">
    <div class="toast-center"></div>
</div>

<script type="text/javascript" src="js/jquery.mini.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script src="js/plupload.full.min.js"></script>
<script src="../js/lib/vue.js"></script>
<script type="text/javascript">
    var _v;
    var vueModel = {
        el: '.user-info-box',
        data: {
            userInfo: {},
            companyInfo: {},
            showUser: true
        },
        created: function() {
        },
        mounted: function() {
            _v = this;

            HQ.ajax("/user/get_user_info", {}, function (data) {
                if (data.code === 0) {
                    _v.userInfo = data.data.user
                    _v.companyInfo = data.data.company
                } else {
                }
            }, function () {
            }, "POST");
        }
    };

    $(function() {
        new Vue(vueModel);
    })

    // 设置语言下拉框事件
    $('.lang-ipt').click(function(){
        var is_show = $(this).attr('is-show');
        $(this).attr('is-show', 1);
        $(this).children('i').addClass('search-arrow-up');
        $('.lang-list').show();
        if(is_show == 1) {
            $('.lang-list').hide();
            $(this).children('i').removeClass('search-arrow-up');
            $(this).attr('is-show', 0);
        }
        return false;
    })
    // 选择语言
    $('.lang-list').on('click', 'li', function(){
        $('.lang-ipt').attr('is-show', 0).children('i').removeClass('search-arrow-up');
        if($('.lang-ipt').text() === $(this).text()) return;
        $('.lang-ipt span').text($(this).text()).attr('data-type',$(this).attr('data-type'));
        $("#lang-ipt").attr('data-type',$(this).attr('data-type'));
        $('.lang-list').hide();
        return false;
    })
    $(".J_set_threshold").click(function(){
        var poition = HQ.util.position.centerPosition($("#J_set_threshold_div"));
        $("#J_set_threshold_div").css({left : poition.left, top : poition.top});
        $("#J_set_threshold_div").fadeIn("slow");
        HQ.util.show_bg();
    });

    $(".J_close_popup").click(function(){
        $(".index-popup").fadeOut("slow");
        $("#bg").fadeOut("slow");
    });

    $("body").click(function(){
        $('.lang-list').hide();
        $('.lang-ipt .search-arrow-down').removeClass('search-arrow-up');
        $('.lang-ipt').attr('is-show', 0);
        $(".sel_pop").hide();
        $(".J_sel").attr("data-isshow", 0);
    });

    // 显示国际区号下拉框
    $(".J_sel_phone_code").click(function(){
        var is_show = $(this).attr("data-isshow");
        $(".sel_pop").hide();
        $(".J_sel").attr("data-isshow", 0);
        if(is_show == 0){
            $(this).attr("data-isshow", 1);
            $(this).next().show();
        }else{
            $(this).attr("data-isshow", 0);
            $(this).next().hide();
        }
        return false;
    });

    $(".J_sel_ul_phone_code a").click(function(){
        var phone_code = parseInt($(this).attr("data-val"));
        $(this).parentsUntil("div").siblings().filter("[name='phone_code']").val(phone_code);
        $(this).parentsUntil("div").siblings().find(".J_phone_code_show").html('+' + phone_code).css("color","#333333");
        $(".sel_pop").hide();
        $(".J_sel").attr("data-isshow", 0);
    });

    // 设置阙值表单是否可见
    if ($("input[name='t_is_alert']:checked").val() == 1) {
        $(".popup-alert-content").find("input").attr("disabled", true);
        $(".popup-alert-content").find("select").attr("disabled", true);
    } else {
        $(".popup-alert-content").find("input").attr("disabled", false);
        $(".popup-alert-content").find("select").attr("disabled", false);
        if (!$("input[name=t_alert_sms_type]").prop("checked")) {
            $(".t_alert_sms_main").find("input").attr("disabled", true);
        }
        if (!$("input[name=t_alert_email_type]").prop("checked")) {
            $(".t_alert_email_main").find("input").attr("disabled", true);
        }
        if (!$("input[name=t_alert_app_type]").prop("checked")) {
            $("input[name='t_alert_app']").attr("disabled", true);
            $("select[name='t_alert_app_user[]']").attr("disabled", true);
        }
    }

    // 阙值短信提醒修改
    $("body").on("change", "input[name=t_alert_sms_type]", function(){
        if ($(this).prop("checked")) {
            $(".t_alert_sms_main").find("input").attr("disabled", false);
        } else {
            $(".t_alert_sms_main").find("input").attr("disabled", true);
        }
    });

    // 阙值邮箱提醒修改
    $("body").on("change", "input[name=t_alert_email_type]", function(){
        if ($(this).prop("checked")) {
            $(".t_alert_email_main").find("input").attr("disabled", false);
        } else {
            $(".t_alert_email_main").find("input").attr("disabled", true);
        }
    });

    // 阙值类型修改
    $("body").on("change", "input[name=t_is_alert]", function(){
        if ($(this).val() == 1) {
            $(".popup-alert-content").find("input").attr("disabled", true);
        } else if ($(this).val() == 2) {
            $(".popup-alert-content").find("input").attr("disabled", false);
            if (!$("input[name=t_alert_sms_type]").prop("checked")) {
                $(".t_alert_sms_main").find("input").attr("disabled", true);
            }
            if (!$("input[name=t_alert_email_type]").prop("checked")) {
                $(".t_alert_email_main").find("input").attr("disabled", true);
            }
        }
    });

    //app通知开关
    $("body").on("change", "input[name=t_alert_app_type]", function(){
        if ($(this).prop("checked")) {
            $("input[name='t_alert_app']").attr("disabled", false);
            $("select[name='t_alert_app_user[]']").attr("disabled", false);
        } else {
            $("input[name='t_alert_app']").attr("disabled", true);
            $("select[name='t_alert_app_user[]']").attr("disabled", true);
        }
    });

    //按钮开关
    var buttonSwitch = false;
    $(".J_save_threshold").click(function(){
        if(buttonSwitch) return ;

        var alert_data = {};
        var rules = {'email': /^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/, 'mobile': /^((\(\d{3}\))|(\d{3}\-))?1(3|4|5|7|8)\d{9}$/,'twmobile': /^\d{10}$/,'hkmobile': /^\d{8}$/,'othermobile': /^\d{6,12}$/, 'integer': /^[1-9]\d*$/};
        var t_is_alert = $("input[name='t_is_alert']:checked").val();
        // 具体金额
        if (t_is_alert == 2) {
            // 阙值金额
            var t_threshold = $.trim($("input[name='t_threshold']").val());
            if (!rules.integer.test(t_threshold) || t_threshold >= 29000.00) {
                $(".t_threshold_tip").show();
                return false;
            } else {
                $(".t_threshold_tip").hide();
                alert_data.threshold = t_threshold;
            }

            // 短信
            if ($("input[name='t_alert_sms_type']").prop('checked')) {
                alert_data.alert_sms_type = 1;

                var alert_sms_arr = [];
                var area_code_arr = [];
                var t_alert_sms_error = false;
                $ ("input[name='t_alert_sms']").each(function(){
                    var sms_tmp = $.trim($(this).val());
                    var area_code_tmp = $.trim($(this).prev().val());

                    if (sms_tmp != "") {

                        if(area_code_tmp=='886'){
                            if (!rules.twmobile.test(sms_tmp)) {
                                $(".t_alert_sms_tip").show();
                                t_alert_sms_error = true;
                                return false;
                            } else {
                                $(".t_alert_sms_tip").hide();
                                area_code_arr.push(area_code_tmp);
                                alert_sms_arr.push($(this).val());
                            }
                        }else if(area_code_tmp=='852'){
                            if (!rules.hkmobile.test(sms_tmp)) {
                                $(".t_alert_sms_tip").show();
                                t_alert_sms_error = true;
                                return false;
                            } else {
                                $(".t_alert_sms_tip").hide();
                                area_code_arr.push(area_code_tmp);
                                alert_sms_arr.push($(this).val());
                            }
                        }else if(area_code_tmp=='86') {
                            if (!rules.mobile.test(sms_tmp)) {
                                $(".t_alert_sms_tip").show();
                                t_alert_sms_error = true;
                                return false;
                            } else {
                                $(".t_alert_sms_tip").hide();
                                area_code_arr.push(area_code_tmp);
                                alert_sms_arr.push($(this).val());
                            }
                        }else {
                            if (!rules.othermobile.test(sms_tmp)) {
                                $(".t_alert_sms_tip").show();
                                t_alert_sms_error = true;
                                return false;
                            } else {
                                $(".t_alert_sms_tip").hide();
                                area_code_arr.push(area_code_tmp);
                                alert_sms_arr.push($(this).val());
                            }
                        }

                    }
                });

                if (t_alert_sms_error) {
                    return false;
                }
                // 至少填写一个手机号
                if (alert_sms_arr.length == 0) {
                    $(".t_alert_sms_tip").show();
                    return false;
                } else {
                    $(".t_alert_sms_tip").hide();
                }
                alert_data.alert_sms_arr = alert_sms_arr;
                alert_data.area_code_arr = area_code_arr;
            } else {
                $(".t_alert_sms_tip").hide();
            }

            // 邮箱
            if ($("input[name='t_alert_email_type']").prop('checked')) {
                alert_data.alert_email_type = 1;

                var alert_email_arr = [];
                var t_email_sms_error = false;
                $ ("input[name='t_alert_email']").each(function(){
                    var sms_tmp = $.trim($(this).val());
                    if (sms_tmp != "") {
                        if (!rules.email.test(sms_tmp)) {
                            $(".t_alert_email_tip").show();
                            t_email_sms_error = true;
                            return false;
                        } else {
                            $(".t_alert_email_tip").hide();
                            alert_email_arr.push($(this).val());
                        }
                    }
                });

                if (t_email_sms_error) {
                    return false;
                }
                // 至少填写一个邮箱
                if (alert_email_arr.length == 0) {
                    $(".t_alert_email_tip").show();
                    return false;
                } else {
                    $(".t_alert_email_tip").hide();
                }
                alert_data.alert_email_arr = alert_email_arr;
            } else {
                $(".t_alert_email_tip").hide();
            }

            //APP通知
            if($("input[name='t_alert_app_type']:visible").prop('checked')){
                alert_data.alert_app_type = 1;
                alert_data.t_alert_app = $("input[name='t_alert_app']:checked").val();
                if(alert_data.t_alert_app == 4){
                    alert_data.t_alert_app_user = $("select[name='t_alert_app_user[]']").val().join(',');
                }
            }
        }

        alert_data.is_alert = t_is_alert;

        buttonSwitch = true;
        $.ajax({
            'url': '/admin/set_credit_threshold',
            'data': alert_data,
            'dataType': 'json',
            'type': 'post',
            'timeout': 20000,
            'success': function(res){
                alert(res.info);
                if(res.status == 1) {
                    window.location.reload();
                }
                buttonSwitch = false;
            },
            'error': function(jqXHR, textStatus, errorThrown){
                alert('网络访问超时，请重新提交');
                buttonSwitch = false;
            }
        });
    });

    $('body').on('click','.clean_upload',function () {
        var _this = $(this);

        _this.siblings('.image_detail').remove();
        _this.parents('.file_name').removeAttr('upload_info');
        _this.remove();
        $('#voucher_logo_view').attr('src','');
    })


    //实例化上传voucher logo
    new plupload.Uploader({
        browse_button : 'voucher_logo', //触发文件选择对话框的按钮，为那个元素id
        url : '/admin/upload_oss', //服务器端的上传页面地址
        file_data_name:'Filedata',//$_FILES的名字
        filters:{
            mime_types:[{
                title:'Image files',//只允许上传图片
                extensions:'jpg,jpeg,png'//文件后缀名
            }],
            max_file_size : '1mb' //最大只能上传2mb的文件
        },
        resize: {
            width: 70,
            height: 70,
            crop: false,
            quality: 90,
            preserve_headers: false
        },
        flash_swf_url : '/static/plupload/js/Moxie.swf', //swf文件，当需要使用swf方式进行上传时需要配置该参数
        silverlight_xap_url : '/static/plupload/js/Moxie.xap', //silverlight文件，当需要使用silverlight方式进行上传时需要配置该参数
        init:{
            FilesAdded:function (uploader,files) {
                uploader.start();
            },
            FileUploaded:function (uploader,file,data) {
                var res = JSON.parse(data.response);

                if(res.status == 1) {
                    var img = '<img class="image_detail" src="'+res.data+'"/>';
                    if(res.status == 1) {
                        var img = '<img class="image_detail" src="'+res.data+'" style="width:70px;height:70px"/>';
                        $('#voucher_logo').prev().remove();
                        //如果按钮不存在,则添加按钮
                        if($('#voucher_logo').siblings('.clean_upload').size() == 0) $('#voucher_logo').after('<span class="clean_upload">删除</span>');

                        $('#voucher_logo').parents('.file_name').prepend(img).attr('upload_info',res.data);
                        $('#voucher_logo_view').attr('src',res.data);
                    } else {
                        alert('上传出错!');
                    }
                } else {
                    alert('上传出错!');
                }

            },
            Error:function (uploader, error) {
                var info = '';
                switch (error.code) {
                    case plupload.FILE_SIZE_ERROR:
                        info = '上传图片大小不能超过1MB，请选择符合要求的文件!';
                        break;
                    case plupload.FILE_EXTENSION_ERROR:
                        info = '要求格式png、jpg，请选择符合要求的文件!';
                        break;
                }
                alert(info);
            }
        }
    }).init();

    // 设置默认语言
    $(".set_lang").click(function(){
        $(".edit-lang").show();
        HQ.util.show_bg();
    });
    $(".edit-title img,.lang-cancel").click(function(){
        $(".edit-lang").hide();
        $("#bg").fadeOut("slow");
    });
    var lang_click = true;
    var old_lang = 'zh';
    $(".lang-done").click(function(){
        $("#bg").fadeOut("slow");
        if (!lang_click) return false;
        lang_click = false;
        var lang = $("#lang-ipt").attr('data-type');
        if (lang != old_lang) {
            $.ajax({
                type: 'POST',
                url: '/admin/set_lang',
                data: {
                    lang: lang
                },
                dataType: 'json',
                success: function(data) {
                    if (data.code) {
                        $('.edit-lang').hide();
                        show_toast('设置成功');
                        $('.default-lang td span').text(lang == 'zh' ? '中文' : '英文');
                        old_lang = lang;
                        lang_click = true;
                    } else {
                        show_toast('设置失败');
                        lang_click = true;
                    }
                },
                error: function() {
                    show_toast('设置失败');
                    lang_click = true;
                }
            });
        } else {
            $(".edit-lang").hide();
            show_toast('设置成功');
            lang_click = true;
        }
    });
    function show_toast(notice_str,time_val) {
        time_val= time_val||'2000';
        $('.toast-center').text(notice_str);
        $('.edit-lang-toast').show();
        setTimeout(function(){
            $('.edit-lang-toast').hide();
        }, time_val)
    }

    $(".J_certification").mouseover(function(){
        var level = '2';
        if(level != 1){
            $(this).siblings('.J_certification_tips').show();
            return false;
        }
    }).mouseout(function(){
        var level = '2';
        if(level != 1){
            $(this).siblings('.J_certification_tips').hide();
            return false;
        }
    }).click(function(){
        var level = '2';
        var status = '0';
        var is_jump = 1;
        if(level == 1){
            window.open("/");
            /*var text_value = "正在跳转实名认证...";
            if(status == 3){
                text_value = "授权书审核中；不可点击";
                is_jump = 0;
            }
            if(status == 2){
                text_value = "提交授权书不符合要求，点击进入经办人认证页面；用户可重新提交信息；";
                is_jump = 1;
            }
            if(status == 1){
                text_value = "完成企业实名认证";
                is_jump = 1;
            }
            if(status == 0){
                text_value = "用户未提交任何企业实名认证资料，点击进入企业认证页面";
            }
            show_toast(text_value,2000);
            $(".toast-center").css("width","200px");
            if(is_jump == 1){
                setTimeout(function(){
                    window.open("https://www.haoqiao.com/certification/index/");
                }, 2000)
            }*/
        }else{
            // show_toast("请登录主账号提交认证信息",2000);
            return false;
        }
    });
    $(".J_icon-notice").mouseover(function(){
        var level = '2';
            $(this).siblings('.J_icon_notice_tips').show();
            return false;
    }).mouseout(function(){
        var level = '2';
            $(this).siblings('.J_icon_notice_tips').hide();
            return false;
    });


</script>


</body></html>